package com.tsingtao.springboot2.config;

import com.baomidou.mybatisplus.annotation.DbType;
import com.baomidou.mybatisplus.core.incrementer.IKeyGenerator;

import java.util.UUID;

public class CustomKeyGenerator implements IKeyGenerator {

    @Override
    public String executeSql(String incrementerName) {
        UUID uuid = UUID.randomUUID();
        int i = uuid.hashCode();
        return String.format("select %s", i);
    }

    @Override
    public DbType dbType() {
        return DbType.MYSQL;
    }

}
